package com.smsc.headend.task.engine.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smsc.headend.module.data.entity.ModuleUnit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

/**
 * @author qinbin
 * @date 2021/07/13
 */
public interface ModuleUnitMapper extends BaseMapper<ModuleUnit> {

    /**
     * 获取系统配置量纲
     *
     * @param subDataItemId
     * @param modelId
     * @param moduleName
     * @return
     */
    @Select("SELECT * FROM MAP_MODULE_UNIT WHERE 1=1 AND SUB_DATA_ITEM_ID = #{subDataItemId} AND MODEL_ID= #{modelId} AND MODULE_NAME = #{moduleName}")
    @ResultType(ModuleUnit.class)
    ModuleUnit getBySubDataItemIdAndModelId(@Param("subDataItemId") Long subDataItemId, @Param("modelId") Long modelId, @Param("moduleName") String moduleName);

}
